package controllers;

import java.util.Date;
import java.util.List;

import models.BlogEntry;
import models.TagReference;
import models.User;
import play.mvc.Controller;
import play.mvc.With;
import controllers.Secure.Security;

public class Blogs extends Controller {

	public static void show(Long id) {
		BlogEntry entry = null;
		entry = BlogEntry.all().filter("id", id).get();
		render(entry);
	}
	
	public static void list(List<BlogEntry> entrys) {
		if(entrys != null) {
			render(entrys);
			return;
		}
		
		entrys = BlogEntry.all().fetch();
		
		render(entrys);
	}	
	
	public static void tag(Long id) {
		List<BlogEntry> entrys = TagReference.getEntrys(id);
		render(entrys);
	}
}
